﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;
using DAL;
using WFNetLib;
using System.Data;

namespace 服务器端.webAPI
{
    public partial class UserLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string id;
            RegResult ret = new RegResult();
            ret.endcodeID = "";
            try
            {
                id = Request.QueryString["ID"];
                //信息|用户id|实验id，实验名，实验室;
                if (string.IsNullOrEmpty(id))//没有这两个变量
                {
                    
                    ret.message = "no id";
                }
                else
                {
                    NurseData n = NurseDataDBOption.Get(id);
                    if (n != null)//为护士
                    {
                        ret.message = "ok";
                        ret.endcodeID = "1";
                    }
                    else
                    {
                        UserInfoData user = UserInfoDataDBOption.Get(id);
                        if (user != null)
                        {
                            ret.message = "ok";
                        }
                        else
                        {
                            ret.message = "Unreg";
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                ret.message = "未知错误" + ex.Message;
            }
            ret.DateTime = DateTime.Now.ToString();
            Response.Write(WFJSON.JsonSerializerBySingleData<RegResult>(ret));
        }
    }
}